home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / lib.fmt / tcl / Tcl_GetInt.man < prev    next >
Encoding:
Text File  |  1991-03-02  |  4.3 KB  |  135 lines

  1.  
  2.  
  3.  
  4. Tcl_GetInt        Tcl Command Language Library         Tcl_GetInt
  5.  
  6.  
  7.  
  8. _________________________________________________________________
  9.  
  10. NNAAMMEE
  11.      Tcl_GetInt, Tcl_GetDouble,  Tcl_GetBoolean  -  convert  from
  12.      string to integer, double, or boolean
  13.  
  14. SSYYNNOOPPSSIISS
  15.      ##iinncclluuddee <<ttccll..hh>>
  16.  
  17.      int
  18.      TTccll__GGeettIInntt(_i_n_t_e_r_p, _s_t_r_i_n_g, _i_n_t_P_t_r)
  19.  
  20.      int
  21.      TTccll__GGeettDDoouubbllee(_i_n_t_e_r_p, _s_t_r_i_n_g, _d_o_u_b_l_e_P_t_r)
  22.  
  23.      int
  24.      TTccll__GGeettBBoooolleeaann(_i_n_t_e_r_p, _s_t_r_i_n_g, _b_o_o_l_P_t_r)
  25.  
  26. AARRGGUUMMEENNTTSS
  27.      Tcl_Interp   *_i_n_t_e_r_p   (in)      Interpreter  to   use   for
  28.                                       error reporting.
  29.  
  30.      char         *_s_t_r_i_n_g   (in)      Textual value  to  be  con-
  31.                                       verted.
  32.  
  33.      int          *_i_n_t_P_t_r   (out)     Points to  place  to  store
  34.                                       integer   value   converted
  35.                                       from _s_t_r_i_n_g.
  36.  
  37.      double       *_d_o_u_b_l_e_P_t_r(out)     Points to  place  to  store
  38.                                       double-precision  floating-
  39.                                       point value converted  from
  40.                                       _s_t_r_i_n_g.
  41.  
  42.      int          *_b_o_o_l_P_t_r  (out)     Points to  place  to  store
  43.                                       boolean value (0 or 1) con-
  44.                                       verted from _s_t_r_i_n_g.
  45.  
  46. _________________________________________________________________
  47.  
  48.  
  49. DDEESSCCRRIIPPTTIIOONN
  50.      These  procedures  convert  from  strings  to  integers   or
  51.      double-precision    floating-point    values   or   booleans
  52.      (represented as 0- or 1-valued integers).  Each of the  pro-
  53.      cedures  takes a _s_t_r_i_n_g argument, converts it to an internal
  54.      form of a particular type, and stores the converted value at
  55.      the  location  indicated  by the procedure's third argument.
  56.      If all goes well, each of the procedures returns TCL_OK.  If
  57.      _s_t_r_i_n_g  doesn't  have the proper syntax for the desired type
  58.      then TCL_ERROR is returned, an  error  message  is  left  in
  59.      _i_n_t_e_r_p->_r_e_s_u_l_t,  and  nothing is stored at *_i_n_t_P_t_r or *_d_o_u_b_-
  60.      _l_e_P_t_r or *_b_o_o_l_P_t_r.
  61.  
  62.  
  63.  
  64.  
  65. Sprite v.1.0         Printed:  March 1, 1991                    1
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72. Tcl_GetInt        Tcl Command Language Library         Tcl_GetInt
  73.  
  74.  
  75.  
  76.      TTccll__GGeettIInntt expects _s_t_r_i_n_g to  consist  of  a  collection  of
  77.      integer digits, optionally signed and optionally preceded by
  78.      white space.  If the first  two  characters  of  _s_t_r_i_n_g  are
  79.      ``0x''  then  _s_t_r_i_n_g  is expected to be in hexadecimal form;
  80.      otherwise, if the first character of _s_t_r_i_n_g  is  ``0''  then
  81.      _s_t_r_i_n_g  is  expected to be in octal form;  otherwise, _s_t_r_i_n_g
  82.      is expected to be in decimal form.
  83.  
  84.      TTccll__GGeettDDoouubbllee expects _s_t_r_i_n_g to consist of a  floating-point
  85.      number,  which  is:   white  space;   a  sign; a sequence of
  86.      digits;  a decimal point;  a sequence of digits;  the letter
  87.      ``e'';   and  a  signed decimal exponent.  Any of the fields
  88.      may be omitted, except that  the  digits  either  before  or
  89.      after  the decimal point must be present and if the ``e'' is
  90.      present then it must be followed by the exponent number.
  91.  
  92.      TTccll__GGeettBBoooolleeaann expects _s_t_r_i_n_g to specify  a  boolean  value.
  93.      If  _s_t_r_i_n_g  is  any  of 00, ffaallssee, or nnoo, then TTccll__GGeettBBoooolleeaann
  94.      stores a zero value at *_b_o_o_l_P_t_r.  If _s_t_r_i_n_g  is  any  of  11,
  95.      ttrruuee,  or  yyeess,  then 1 is stored at *_b_o_o_l_P_t_r.  Any of these
  96.      values may be abbreviated, and upper-case spellings are also
  97.      acceptable.
  98.  
  99.  
  100. KKEEYYWWOORRDDSS
  101.      boolean, conversion, double, floating-point, integer
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131. Sprite v.1.0         Printed:  March 1, 1991                    2
  132.  
  133.  
  134.  
  135.